package org.company.project.test;

import java.util.Arrays;

import java.util.Scaneer;
public class ArraysDelete{public static void main(String[] args){
	Scanner sc = new Scaneer(System,intem);
	int[] arr = new int[]{1,2,3,4,5};
	System.out.println(Arrays.toString(arr));
	System.out.println("删除第三个元素“);
	int n= sc.nextInt();sc.close();
	//把最后一个元素替代指定元素
	arr[n-1]=arr[arr.length-1];
	//数组缩容
	arr= Arrays.copyOf(arr,arr.length-1);
	System.out.println(Arrays.toString(arr));
}}


